package com.woniu.outpatient.service.impl;

import java.math.BigDecimal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.woniu.outpatient.mapper.PrescriptionMapper;
import com.woniu.outpatient.domain.Prescription;
import com.woniu.outpatient.service.IPrescriptionService;

/**
 * 药单流水表Service业务层处理
 * 
 * @author wolf-six
 * @date 2023-02-15
 */
@Service
public class PrescriptionServiceImpl implements IPrescriptionService 
{
    @Autowired
    private PrescriptionMapper prescriptionMapper;

    /**
     * 查询药单流水表
     * 
     * @param prescriptionId 药单流水表主键
     * @return 药单流水表
     */
    @Override
    public Prescription selectPrescriptionByPrescriptionId(Long prescriptionId)
    {
        return prescriptionMapper.selectPrescriptionByPrescriptionId(prescriptionId);
    }

    /**
     * 查询药单流水表列表
     * 
     * @param prescription 药单流水表
     * @return 药单流水表
     */
    @Override
    public List<Prescription> selectPrescriptionList(Prescription prescription)
    {
        return prescriptionMapper.selectPrescriptionList(prescription);
    }

    /**
     * 新增药单流水表
     * 
     * @param prescription 药单流水表
     * @return 结果
     */
    @Override
    public int insertPrescription(Prescription prescription)
    {
        return prescriptionMapper.insertPrescription(prescription);
    }

    /**
     * 修改药单流水表
     * 
     * @param prescription 药单流水表
     * @return 结果
     */
    @Override
    public int updatePrescription(Prescription prescription)
    {
        return prescriptionMapper.updatePrescription(prescription);
    }

    /**
     * 批量删除药单流水表
     * 
     * @param prescriptionIds 需要删除的药单流水表主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionByPrescriptionIds(Long[] prescriptionIds)
    {
        return prescriptionMapper.deletePrescriptionByPrescriptionIds(prescriptionIds);
    }

    /**
     * 删除药单流水表信息
     * 
     * @param prescriptionId 药单流水表主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionByPrescriptionId(Long prescriptionId)
    {
        return prescriptionMapper.deletePrescriptionByPrescriptionId(prescriptionId);
    }

    @Override
    public BigDecimal drugCost(Long patientId) {
        return prescriptionMapper.drugCost(patientId);
    }
}
